var path = require('path');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');

var config = {
  entry: './src/index.js',

  output: {
    path:path.resolve(__dirname, './dist'),
    filename: 'bundle.js'
  },

  devServer: {
    // inline: true,
    port: 8090
  },

  module: {
    rules: [
      {
        test: /\.(js|jsx)$/,
        exclude: /node_modules/,
        use: 'babel-loader'
      },
      {
        test: /\.css$/,
        use:[
          {loader: 'style-loader'},
          {loader: 'css-loader'}
        ]
      },
      {
      test: /\.(png)(\?v=\d+\.\d+\.\d+)?$/,
      use: {
        loader: 'file-loader',
      }
    }
    ]
  },
  plugins:[
    // new webpack.optimize.UglifyJsPlugin(),
    new HtmlWebpackPlugin({template: './index.html'})
  ]
};
module.exports = config;
